# -*- coding:utf-8 -*-

import os
import re
import time


# 获取根路径
def root_path():
    file_address = os.path.dirname(os.path.realpath(__file__)).replace('\\', '/')
    root_address = re.findall(r'(.*)utils', file_address)
    return root_address[0]

# 获取excel用例文件位置
def excel_path():
    excel_file = root_path() + "data/测试用例完整版.xlsx"
    return excel_file

# 测试报告的地址
def result_dir():
    result_dir = root_path() + "report/json_report"
    return result_dir

# ini文件地址
def environment_ini_path():
    ini_path = root_path() + "config/environment.ini"
    return ini_path

# 消息配置地址
def message_ini_path():
    ini_path = root_path() + "config/messages.ini"
    return ini_path


# 慢接口存放的地址
def slow_api_path():
    api_path = root_path() + f"slow_api/api_requests{str(time.strftime('%Y-%m-%d'))}.csv"
    return api_path

